/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Connection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 *
 * @author SONY
 */
public class CheckInfo {
    private static Pattern pattern = null;
    private static Matcher matcher = null;
    
    public static Boolean checkEmpty(String s){
        if (s == null || s.length() == 0 || s.equals(" ")){
            return false;
        } else return true; 
    }
    
    public static Boolean checkNumber(String s){
        if (s == null || s.length() == 0) {
            return false;
        } else {
            pattern = Pattern.compile("^[-+]?[0-9]*\\.?[0-9]+$");
            matcher = pattern.matcher(s);
            return matcher.matches();
        }
    }
    
    public static Boolean checkEmail(String s){
        if(s == null || s.length() == 0){
            return false;
        } else {
            pattern = Pattern.compile(".+@.+\\.[a-z]+");
            matcher = pattern.matcher(s);
            return matcher.matches();
        }
    }
    
}
